USE [OHNEW]
GO

/****** Object:  Table [dbo].[D_PayInvoice]    Script Date: 11/30/2012 21:22:16 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[D_PayInvoice](
	[ID] [uniqueidentifier] NOT NULL,
	[Code] [varchar](50) NOT NULL,
	[DocumentType] [int] NOT NULL,
	[Company] [uniqueidentifier] NOT NULL,
	[Vendor] [uniqueidentifier] NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[Money] [decimal](18, 2) NOT NULL,
	[Tax] [decimal](18, 2) NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[Notes] [varchar](50) NOT NULL,
	[CreatedBy] [uniqueidentifier] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_D_PayInvoice] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[D_PayInvoice] ADD  CONSTRAINT [DF__D_PayInvoice__ID__37FA4C37]  DEFAULT (newid()) FOR [ID]
GO